#!/bin/bash
set -e
# rm -rf build
os=$(uname)
if [ "$os" = "Linux" ]; then
    cmake -B build
elif [[ "$os" == *"MINGW"* ]]; then
    cmake -B build -G"MinGW Makefiles"
else
    echo "unknown os"
    exit 1
fi

cmake --build build -j$(nproc)
# ctest --test-dir build -V
ctest --test-dir build